<?php


namespace App\Http\Controllers\cms;


use App\Engine\BaseController;
use App\Models\User as UserModel;
use App\Models\Article as ArticleModel;
use App\Models\House as HouseModel;
use App\Models\Project as ProjectModel;
use App\Models\Yuyue as YuyueModel;
use App\Models\Banner as BannerModel;
use function app\Utils\go;

class Home extends BaseController
{
    public function statistics()
    {
        $user=UserModel::count();
        $article=ArticleModel::count();
        $house=HouseModel::count();
        $project=ProjectModel::count();
        $yuyue=YuyueModel::where('state',0)->count();
        $banner=BannerModel::count();
        $data=array();
        $data[]=[
            'title'=>'广告',
            'value'=>$banner,
            'tips'=>''
        ];
        $data[]=[
            'title'=>'文章',
            'value'=>$article,
            'tips'=>''
        ];

        $data[]=[
            'title'=>'项目',
            'value'=>$project,
            'tips'=>''
        ];
        $data[]=[
            'title'=>'房屋',
            'value'=>$house,
            'tips'=>''
        ];
        $data[]=[
            'title'=>'预约',
            'value'=>$yuyue,
            'tips'=>''
        ];
        $data[]=[
            'title'=>'预约',
            'value'=>$yuyue,
            'tips'=>''
        ];

        $data[]=[
            'title'=>'用户',
            'value'=>$user,
            'tips'=>''
        ];
        return go($data);


    }
}
